<div class="container">
    <h1 id="pkg-overview">package jsonrpc</h1>
    <p><code>import "net/rpc/jsonrpc"</code>
    </p><p>jsonrpc包实现了JSON-RPC的ClientCodec和ServerCodec接口，可用于rpc包。</p>
    
    
		
        
        
        
        
        
    
    <h2 id="Dial">func <a href="https://github.com/golang/go/blob/master/src/net/rpc/jsonrpc/client.go?name=release#117" title="View Source">Dial</a> </h2>
    <pre class="funcdecl">func Dial(network, address <a href="builtin.htm#string">string</a>) (*<a href="net/rpc.htm">rpc</a>.<a href="net/rpc.htm#Client">Client</a>, <a href="builtin.htm#error">error</a>)</pre>
    <p>Dial在指定的网络和地址连接一个JSON-RPC服务端。</p>
    <h2 id="NewClient">func <a href="https://github.com/golang/go/blob/master/src/net/rpc/jsonrpc/client.go?name=release#112" title="View Source">NewClient</a> </h2>
    <pre class="funcdecl">func NewClient(conn <a href="io.htm">io</a>.<a href="io.htm#ReadWriteCloser">ReadWriteCloser</a>) *<a href="net/rpc.htm">rpc</a>.<a href="net/rpc.htm#Client">Client</a></pre>
    <p>NewClient返回一个新的rpc.Client，以管理对连接另一端的服务的请求。</p>
    <h2 id="NewClientCodec">func <a href="https://github.com/golang/go/blob/master/src/net/rpc/jsonrpc/client.go?name=release#36" title="View Source">NewClientCodec</a> </h2>
    <pre class="funcdecl">func NewClientCodec(conn <a href="io.htm">io</a>.<a href="io.htm#ReadWriteCloser">ReadWriteCloser</a>) <a href="net/rpc.htm">rpc</a>.<a href="net/rpc.htm#ClientCodec">ClientCodec</a></pre>
    <p>NewClientCodec返回一个在连接上使用JSON-RPC的rpc.ClientCodec。</p>
    <h2 id="NewServerCodec">func <a href="https://github.com/golang/go/blob/master/src/net/rpc/jsonrpc/server.go?name=release#37" title="View Source">NewServerCodec</a> </h2>
    <pre class="funcdecl">func NewServerCodec(conn <a href="io.htm">io</a>.<a href="io.htm#ReadWriteCloser">ReadWriteCloser</a>) <a href="net/rpc.htm">rpc</a>.<a href="net/rpc.htm#ServerCodec">ServerCodec</a></pre>
    <p>NewServerCodec返回一个在连接上使用JSON-RPC的rpc. ServerCodec。</p>
    <h2 id="ServeConn">func <a href="https://github.com/golang/go/blob/master/src/net/rpc/jsonrpc/server.go?name=release#132" title="View Source">ServeConn</a> </h2>
    <pre class="funcdecl">func ServeConn(conn <a href="io.htm">io</a>.<a href="io.htm#ReadWriteCloser">ReadWriteCloser</a>)</pre>
    <p>ServeConn在单个连接上执行DefaultServer。ServeConn会阻塞，服务该连接直到客户端挂起。调用者一般应另开线程调用本函数："go serveConn(conn)"。ServeConn在该连接使用JSON编解码格式。</p>
</div>